#ifndef __MY_HASHMAP_H_
#define __MY_HASHMAP_H_

typedef struct{
    char devid[20];//key
    int devfd;//设备端fd
    int userfd;//qt端fd
}data_t;

typedef struct pn{
    union{
        int subLen;
        data_t data;
    };
    struct pn* next;
}node_t;

typedef struct{
    node_t* arr[20];
    int len;
}hashmap_t;

hashmap_t* hashmap_create();
void hashmap_destroy(hashmap_t* mp);
int hashmap_hashcode(char* key);
void hashmap_put(hashmap_t* mp, char* key, data_t value);
data_t* hashmap_get(hashmap_t* mp, char* key);
void hashmap_remove(hashmap_t* mp, char* key);
int hashmap_size(hashmap_t* mp);  
void hashmap_printself(hashmap_t* map);



#endif